notebook: Include arrow size in tab size computation
authorBenjamin Otte <otte@redhat.com>
Wed, 1 Jun 2011 15:45:14 +0000 (17:45 +0200)
committerBenjamin Otte <otte@redhat.com>
Wed, 1 Jun 2011 15:46:22 +0000 (17:46 +0200)
We don't want tabs to resize when a 2nd page is added, just because the
scroll arrows are now visible. And we do want the arrow size to be
included.

Note: Previosuly this code was never run, as the check
  requisition->width < tab_width
was only run when tab_width wasn't computed, so was still equal to 0
(same for the height). So what this patch essentially does it add the
functionality of the if switch.

gtk/gtknotebook.c

index 77e8a47f7b7c38120a6f0c03ec354f8127de904f..ad9412ff55be56e008d4a4b5a35c337c85ba95bc 100644 (file)
@@ -2113,8 +2113,7 @@ gtk_notebook_size_request (GtkWidget      *widget,
                   if (tab_height == 0)
                     break;
 
-                  if (priv->scrollable && vis_pages > 1 &&
-                      requisition->width < tab_width)
+                  if (priv->scrollable)
                     tab_height = MAX (tab_height, scroll_arrow_hlength);
 
                   tab_height = MAX (tab_height, action_widget_requisition[ACTION_WIDGET_START].height);
@@ -2160,10 +2159,8 @@ gtk_notebook_size_request (GtkWidget      *widget,
                   if (tab_width == 0)
                     break;
 
-                  if (priv->scrollable && vis_pages > 1 &&
-                      requisition->height < tab_height)
-                    tab_width = MAX (tab_width,
-                                     arrow_spacing + 2 * scroll_arrow_vlength);
+                  if (priv->scrollable)
+                    tab_width = MAX (tab_width, arrow_spacing + 2 * scroll_arrow_vlength);
 
                   tab_width = MAX (tab_width, action_widget_requisition[ACTION_WIDGET_START].width);
                   tab_width = MAX (tab_width, action_widget_requisition[ACTION_WIDGET_END].width);